from spider.spider_execute import spider_execute
from data_analysis.cluster_analysis import cluster_analysis
from data_analysis.hottopic_analysis import hottopic_analysis
from data_analysis.emotion_analysis_bhsenti import emotion_analysis_bhsenti
from data_analysis.data_upgrade import data_upgrade
from data_analysis.emotion_pie import emotion_pie
from data_analysis.topic_popularity_analysis import topic_popularity_analysis
# from data_analysis.topic_recognize.model_use import topic_recognize
import time
from data_analysis.emotion_seven import emotion_seven

if __name__ == '__main__':
    while True:
        print("爬虫启动中......")
        spider_execute()
        print("爬取成功！！！")
        # print("即将开始话题识别处理，话题统计图生成中......")
        # topic_recognize()
        # print("话题统计图生成成功！！！")
        print("即将开始话题热度趋势分析......")
        topic_popularity_analysis()
        print("话题热度时间变化趋势图生成完毕！！！")
        print("聚类分析启动中，即将开始生成云词图......")
        cluster_analysis()
        print("云词图生成成功！！！")
        print("即将开始热门话题分析......")
        hottopic_analysis()
        print("热门话题分析成功！！！统计图已生成完毕！！！")
        print("情感分析启动中......")
        emotion_analysis_bhsenti()
        emotion_pie()
        emotion_seven()
        print("情感分析成功！！！分析数据已存入表格！！！")
        print("即将开始数据库更新......")
        data_upgrade()
        print("数据库更新完毕！！！！！！")
        time.sleep(3600 * 6)
